package com.bwie.controller;

import com.bwie.pojo.TbGift;
import com.bwie.pojo.TbGiftRecord;
import com.bwie.pojo.TbGiftStrategy;
import com.bwie.service.TbGiftService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.PostConstruct;

/**
 * @Author: zhaijiaqi
 * @Date: 2025/7/15 11:47
 * @Description:
 **/
@RestController
@RequestMapping("/gift/index")
public class IndexController {

    @Autowired
    TbGiftService tbGiftService;

    /**
     * 礼金分页列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/getGiftPage")
    public R getGiftPage(@RequestBody PageInfoVo pageInfoVo){
        return tbGiftService.getGiftPage(pageInfoVo);
    }

    /**
     * 字典类表查询
     * @param DictId
     * @return
     */
    @PostMapping("/getDictListById/{TypeId}")
    public R getDictListById(@PathVariable("TypeId") Integer TypeId){
        return tbGiftService.getDictListById(TypeId);
    }

    /**
     * 上传LOGO
     * @param file
     * @return
     */
    @PostMapping("/uploadImage")
    public R uploadImage(@RequestPart("file")MultipartFile file){
        return tbGiftService.uploadImage(file);
    }

    /**
     * 添加品牌礼金
     * @param tbGift
     * @return
     */
    @PostMapping("/getAddGift")
    public R getAddGift(@RequestBody TbGift tbGift){
        return tbGiftService.getAddGift(tbGift);
    }


    /**
     * 添加注册成功策略
     * @param
     * @return
     */
    @PostMapping("/getAddStrate")
    public R getAddStrate(){
        return tbGiftService.getAddStrate();
    }

    /**
     * 领取品牌礼金
     * @param giftId
     * @return
     */
    @PostMapping("/getClaimGift/{giftId}")
    public R getClaimGift(@PathVariable("giftId") Integer giftId){
        return tbGiftService.getClaimGift(giftId);
    }

    /**
     * 获取礼金列表
     * @param statusId
     * @return
     */
    @PostMapping("/getMyGiftList/{statusId}")
    public R getMyGiftList(@PathVariable("statusId")Integer statusId){
        return tbGiftService.getMyGiftList(statusId);
    }

    /**
     * 获取礼金列表
     * @param statusId
     * @return
     */
    @PostMapping("/getAllMyGiftList")
    public R getAllMyGiftList(){
        return tbGiftService.getAllMyGiftList();
    }

}
